<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <form action="${user==null?'/user/submit':'/user/update'}" method="post">
            <table>
                <tbody>
                    <tr>
                        <td><label>ID</label></td>
                        <td><input name="user.id" value="${user.id}"/></td>
                    </tr>
                    <tr>
                        <td><label>姓名</label></td>
                        <td><input name="user.name" value="${user.name}" type="text" placeholder="请输入姓名"/></td>
                    </tr>
                    <tr>
                        <td><label>年龄</label></td>
                        <td><input name="user.age" value="${user.age}" type="text" placeholder="请输入年龄"/></td>
                    </tr>
                    <tr>
                        <td><label>性别</label></td>
                        <td>
                            <input type="radio" name="user.sex" <c:if test="$user!=null&&user.sex==1">checked="checked"</c:if>value="1"/>男
                            <input type="radio" name="user.sex" <c:if test="$user!=null&&user.sex==0">checked="checked"</c:if>value="0"/>女
                            <input type="radio" name="user.sex" <c:if test="$user!=null&&user.sex==10">checked="checked"</c:if>value="10"/>保密
                            </td>
                        </tr>
                        <tr>
                            <td><label>备注</label></td>
                            <td><textarea type="text" name="user.remark" placeholder="请输入备注信息">${user.remark}</textarea></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td><input type="submit" value="提交"/></td>
                    </tr>
                </tbody>
            </table> 
        </form>
    </body>
</html>
